<?php

class Form_Status extends Form_Custom_General {

    public function init() {
   
       $st_type = $this->createElement('select', 'st_type')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select status type')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array('class' => "select2", "placeholder" => ""));
        $this->addElement($st_type);
        
        
        
       $date_sale = $this->createElement('text', 'date_sale')
                ->setRequired(TRUE)
                ->setValue(date('Y-m-d'))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select date')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60", "readonly" =>"readonly", "class" => "span6 input-large datepicker"));
       $this->addElement($date_sale);
       
       
       
        
        $st_start_date = $this->createElement('text', 'st_start_date')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control  status-client_datepicker"));
        $this->addElement($st_start_date);
        
        $st_end_date = $this->createElement('text', 'st_end_date')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control  status-client_datepicker"));
        $this->addElement($st_end_date);
        
        $stpriceValidator = new Zend_Validate_Float();
	$stpriceValidator->setMessage('Please enter valid price');
        
        
        $st_price = $this->createElement('text', 'st_price')
                ->setRequired(TRUE)
                ->addValidator($stpriceValidator, true)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter price.')))
                ->setAttribs(Array('class' => "form-control status-client_note"));
        $this->addElement($st_price);
        
        
        
        $vat_rate = $this->createElement('select', 'vat_rate')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control select2"));
        $this->addElement($vat_rate);
        
        $vat = $this->createElement('text', 'vat')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note", "readonly" =>"readonly"));
        $this->addElement($vat);
        
        $total_price = $this->createElement('text', 'total_price')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note", "readonly" =>"readonly"));
        $this->addElement($total_price);
        
        $agent_id = $this->createElement('select', 'agent_id')
                #->setRequired(TRUE)
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select member')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array('class' => "form-control select2", "placeholder" => ""));
        $this->addElement($agent_id);
        
        
        $agent_commission = $this->createElement('text', 'agent_commission')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note"));
        $this->addElement($agent_commission);
        
        
        $referral_name = $this->createElement('select', 'referral_name')
                #->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select member')))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array('class' => "form-control select2", "placeholder" => ""));
        $this->addElement($referral_name);
   

        $referral_commission = $this->createElement('text', 'referral_commission')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note"));
        $this->addElement($referral_commission);
        
        $other_name = $this->createElement('text', 'other_name')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note"));
        $this->addElement($other_name);
        
        $other_commission = $this->createElement('text', 'other_commission')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note"));
        $this->addElement($other_commission);
        
        $otherCostValidator = new Zend_Validate_Float();
	$otherCostValidator->setMessage('cost should be valid number.');
        $other_costs = $this->createElement('text', 'other_costs')
                #->setRequired(TRUE)
                ->addValidator($otherCostValidator, true)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note"));
        $this->addElement($other_costs);
        
        $landtourist_profit = $this->createElement('text', 'landtourist_profit')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                #->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Please select country.')))
                ->setAttribs(Array('class' => "form-control status-client_note"));
        $this->addElement($landtourist_profit);
        
       
    }

}